package com.crazymaker.springcloud.demo.start;

import com.crazymaker.springcloud.standard.properties.RedisRateLimitProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@SpringBootApplication(scanBasePackages = {
        "com.crazymaker.springcloud.demo",
        "com.crazymaker.springcloud.standard"
})
@EnableEurekaClient
// 开启Feign
@EnableFeignClients(basePackages = {
        "com.crazymaker.springcloud.demo.api"
})
@EnableConfigurationProperties(RedisRateLimitProperties.class)
// 开启Hystrix
@EnableHystrix
@EnableSwagger2
@Slf4j
public class DemoApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(DemoApplication.class, args);
    }
}
